package com.cvte.boe.media.model;

import com.cvte.boe.media.utils.LogUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wuguitong on 2018/5/22.
 */
public class LrcRow implements Comparable<LrcRow>{
    private final static String TAG = "LrcRow";
    public static final long END_TIME = -1;
    private String strStartTime;
    private long startTime;
    private long endTime;
    private String content;

    public LrcRow(String strStartTime, long startTime, String content) {
        this.strStartTime = strStartTime;
        this.startTime = startTime;
        this.content = content;
        endTime = END_TIME;
    }


    @Override
    public String toString() {
        return "[" + strStartTime + "]" + content;
    }

    @Override
    public int compareTo(LrcRow another) {
        return (int)(this.startTime - another.startTime);
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public String getStrStartTime() {
        return strStartTime;
    }

    public void setStrStartTime(String strStartTime) {
        this.strStartTime = strStartTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public boolean isContainTime(long time){
        if(endTime == END_TIME){
            if(time >= startTime){
                return true;
            }else {
                return false;
            }
        }else {
            if (time >= startTime && time < endTime){
                return true;
            }else {
                return false;
            }
        }
    }
}
